<#ibiztemplate>
TARGET=PSDESERVICEAPI
</#ibiztemplate>
<#if item.isMajor()>
<#macro buildApi deapi rootPath levels>
<#if deapi.getPSDEServiceAPIMethods()??>
<#list deapi.getPSDEServiceAPIMethods() as apiMethod>
	<#if apiMethod.getActionType()=='DEACTION'>
	@ApiOperation(value = "${apiMethod.getPSDEAction().getLogicName()}", tags = {"${item.getCodeName()}" },  notes = "${apiMethod.getPSDEAction().getLogicName()}")
    @RequestMapping(method= RequestMethod.${apiMethod.getRequestMethod()} , value="${rootPath}<#if (apiMethod.getPSDEAction().getName()=='Create')><#else>/{${deapi.getPSDataEntity().getKeyPSDEField().getCodeName()?lower_case}}</#if><#if (apiMethod.getPSDEAction().getName()='Get'||apiMethod.getPSDEAction().getName()='Create'||apiMethod.getPSDEAction().getName()='Update'||apiMethod.getPSDEAction().getName()='Remove')><#else>/${apiMethod.getPSDEAction().getCodeName()?lower_case}</#if>")
	public ${deapi.getCodeName()} ${apiMethod.getPSDEAction().getCodeName()}${deapi.getPSDataEntity().getCodeName()}(<#list levels as level>@PathVariable String ${level},</#list>@PathVariable String ${deapi.getPSDataEntity().getKeyPSDEField().getCodeName()?lower_case}<#if (apiMethod.getRequestMethod()=='GET')><#else>/*,@RequestBody ${deapi.getCodeName()} ${deapi.getPSDataEntity().getCodeName()?lower_case}*/</#if>) {
		return null ;
	}
	<#elseif apiMethod.getActionType()=='FETCH'>
	@ApiOperation(value = "获取${apiMethod.getPSDEDataSet().getLogicName()}", tags = {"${item.getCodeName()}" } ,notes = "获取${apiMethod.getPSDEDataSet().getLogicName()}")
    @RequestMapping(method= RequestMethod.${apiMethod.getRequestMethod()} , value="${rootPath}/search<#if (apiMethod.getPSDEDataSet().getName()=='DEFAULT')><#else>-${apiMethod.getPSDEDataSet().getCodeName()?lower_case}</#if>")
	public List<${deapi.getCodeName()}> search${deapi.getPSDataEntity().getCodeName()}<#if (apiMethod.getPSDEDataSet().getName()=='DEFAULT')><#else>${apiMethod.getPSDEDataSet().getCodeName()}</#if> () {
		return null ;
	}
	</#if>
	

</#list>
</#if>
<#if deapi.getPSDEServiceAPIRSs()??>
<#list deapi.getPSDEServiceAPIRSs() as apider>
	<@buildApi deapi=apider.getMinorPSDEServiceAPI() rootPath= rootPath + '/{' + deapi.getPSDataEntity().getKeyPSDEField().getCodeName()?lower_case +'}/' + apider.getMinorPSDEServiceAPI().getCodeName()?lower_case levels= levels + [deapi.getPSDataEntity().getKeyPSDEField().getCodeName()?lower_case] />
</#list>
</#if>
</#macro>
package ${pub.getPKGCodeName()}.api.${item.getPSSysServiceAPI().getCodeName()?lower_case}.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ${pub.getPKGCodeName()}.api.${item.getPSSysServiceAPI().getCodeName()?lower_case}.model.*;
import com.alibaba.fastjson.JSONObject;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;

@Api(tags = {"${item.getCodeName()}" }, description = "${item.getName()}")
@RestController
@RequestMapping("/${item.getPSSysServiceAPI().getCodeName()?lower_case}/${item.getCodeName()?lower_case}")
public class ${item.getCodeName()}Resource {

	<@buildApi deapi=item rootPath='' levels=[] />

}
</#if>